package com.zyt.ssss.service.impl;

import com.zyt.ssss.dao.ResumeDao;
import com.zyt.ssss.pojo.Resume;
import com.zyt.ssss.service.IResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

/**
 * @author zyt
 * @createDate 2020/05/14 9:25 PM
 */
@Service
public class ResumeServiceImpl implements IResumeService {
    @Autowired
    private ResumeDao resumeDao;

    @Override
    public List<Resume> findAll() {
        List<Resume> resumes = resumeDao.findAll();
        return resumes;
    }

    @Override
    public Resume findById(Long id) {
        Optional<Resume> optional = resumeDao.findById(id);
        return optional.get();
    }

    @Override
    public Resume save(Resume resume) {
        Resume save = resumeDao.save(resume);
        return save;
    }

    @Override
    public void delete(Long id) {
        resumeDao.deleteById(id);
    }
}
